import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
const store = new Vuex.Store({
    namespaced: true,
    state: {
        userData:null,
        getTalkList: JSON.parse(sessionStorage.getItem(`getTalkList`))||{},
        getChat:JSON.parse(sessionStorage.getItem(`getChat`))||[],
        getTalkDetail:JSON.parse(sessionStorage.getItem(`getTalkDetail`))||[],
	},
    mutations: {
        setUserData(state,data){
            state.userData = data
        },
        setGetTalkList(state,data){
            sessionStorage.setItem('getTalkList',JSON.stringify(data))
            state.getTalkList = data
        },
        setGetChat(state,data){
            sessionStorage.setItem('getChat',JSON.stringify(data))
            state.getChat = data
        },
        setGetTalkDetail(state,data){
            sessionStorage.setItem('getTalkDetail',JSON.stringify(data))
            state.getTalkDetail = data
        },
	},
    actions: {}
})
export default store